import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/global.css'
import './plugins/element.js'
import ZkTable from 'vue-table-with-tree-grid'
import axios from 'axios'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
axios.defaults.baseURL='https://www.liulongbin.top:8888/api/private/v1/'
axios.interceptors.request.use(config=>{
  
  config.headers.Authorization=window.sessionStorage.getItem("token")
  return config
})

Vue.prototype.$http=axios
Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(VueQuillEditor, /* { default global options } */)
Vue.component('tree-table',ZkTable)
Vue.filter('dateFormat',function(originVal){
  const date = new Date(originVal);
  const y=date.getFullYear();
  const m=(date.getMonth()+1+'').padStart(2,'0');
  const d=(date.getDate()+'').padStart(2,'0');
  const hh=(date.getHours()+'').padStart(2,'0');
  const mm=(date.getMinutes()+'').padStart(2,'0');
  const ss=(date.getSeconds()+'').padStart(2,'0');
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
